﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace DotNet.WebUI.BasicControl
{
    public partial class DdlList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            for (int i = 1; i <= 50; i++ )
            {
                if(i%2==1 && i%3== 0)
                {
                    ddlZhengC.Items.Add(i.ToString());
                }
            }
        }

        protected void ddlZhengC_SelectedIndexChanged(object sender, EventArgs e)
        {
            txtJieG.Text = ddlZhengC.SelectedItem.Text;
        }

        protected void btnCity_Click(object sender, EventArgs e)
        {

            string[] _City = { "五华区", "盘龙区", "西山区", "官渡区", "安宁县", "嵩明县", "石林县", "呈贡县", "宜良县" };

            ddlCity.DataSource = _City;
            ddlCity.DataBind();
        }

        protected void ddlCity_SelectedIndexChanged(object sender, EventArgs e)
        {
            txtCity.Text = ddlCity.SelectedIndex.ToString();
        }
    }
}